<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>


<script >
   function  deleteSome(){
	   var chks=document.getElementsByName("chk");
	   var  sids="";
	 for(var  i=0;i<chks.length;i++){
	    if(chks[i].checked==true){
		   sids=sids+chks[i].value+",";
	    }
	 }
	    window.location.href="deleteSome.do?sids="+sids;
   }
   
   function   loadPage(){
	   var   pageCount=${pageCount};
	   var  str="";
	    for(var i=1;i<=pageCount;i++){
	    	str=str+"<a href='pagion.do?pageNum="+i+"'> ["+i+"] </a>";
	    }
	    
	    document.getElementById("s1").innerHTML=str;
   }
   
   
   
   
   
   
   
   

</script>

</head>
<body    onload="loadPage()">
 <input type="button"  value="批量删除"  onClick="deleteSome()" />

 <table  border=1px>
   <tr>
     <th>选择</th>
    <th>学生主键</th>
     <th>用户名</th>
     <th>学号</th>
     <th>性别</th>
     <th>手机号码</th>
     <th>删除</th>
     <th>修改</th>
   </tr> 
   
   <c:forEach  items="${studentlist}"    var="student">
    <tr>
    <td>
   <input  type="checkbox"    name="chk"  value="${student.sid}"/>
     </td>
    <td>
      ${student.sid}
    </td>
    <td>
    ${student.name}
    </td>
    <td>
    ${student.sno}
    </td>
    <td>
    <c:if  test="${student.gender=='0'}">
              男
    </c:if>
    <c:if  test="${student.gender=='1'}">
              女
    </c:if>
    </td>
    <td>
    ${student.telephone}
    </td>
    <td>
    <a  href="delete.do?sid=${student.sid}" >删除</a>
    </td>
    <td>
    <a  href="update.do?sid=${student.sid}" >修改</a>
    </td>
    </tr>
   </c:forEach>
   
   
   
 
 </table>
    <span  id="s1">  </span>
 
 
</body>
</html>